using System;
using System.Configuration;

namespace NWrapper.Config
{
	/// <summary>
	/// Represents the configuration for a given entity or set of entities in a repository.
	/// </summary>
	public class EntitySettings : ConfigurationElement
	{
		/// <summary>
		/// Base constructor.
		/// </summary>
		public EntitySettings()
			: base()
		{
		}

		/// <summary>
		/// Constructor which sets the <see cref="Assembly"/> property to the given value.
		/// </summary>
		/// <param name="assembly">The assembly where the entities are located.</param>
		public EntitySettings(string assembly)
			: base()
		{
			this.Assembly = assembly;
		}

		/// <summary>
		/// Gets or sets the assembly name where the entities are located.
		/// </summary>
		[ConfigurationProperty("assembly", IsKey = true, IsRequired = true)]
		public string Assembly
		{
			get { return (string)base["assembly"]; }
			set { base["assembly"] = value; }
		}
	}
}
